package logger

import (
	"fmt"
	"github.com/sudot/yapi-tools/internal"
	"github.com/utahta/go-cronowriter"
)

var log *cronowriter.CronoWriter

func init() {
	log = cronowriter.MustNew(fmt.Sprintf("%s/logs/%s.log", internal.WorkPath, "%Y%m/%d"))
}

func Info(m string) {
	_, _ = log.Write([]byte(m + "\n"))
}

func Infof(format string, arg ...interface{}) {
	Info(fmt.Sprintf(format, arg))
}
